<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>20级Java方向学生信息</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" th:inline="javascript">
        /*定义项目根路径*/
        var basePath = [[${#request.getContextPath()}]]

        //查询学生信息总数
        function queryCount() {
            $.ajax({
                url: basePath + '/studentInfo20/queryCount',
                method: 'post',
                success: function (result) {
                    $('#totalCount').text(result)
                }
            })
        }

    </script>
</head>
<body>
<button type="button" onclick="queryCount()">查询学生总人数</button>
<div>学生总数是: <span style="background-color: gray;color: red" id="totalCount"></span></div>
<div>
    <form action="" th:action="@{/studentInfo20/queryOne}">
        <label>姓名:
            <input type="text" name="chineseName" placeholder="请输入姓名">
        </label>
        <label>
            学号: <input type="text" name="studentId" placeholder="请输入学号">
        </label>
        <input type="submit" value="查询">
    </form>
</div>
<div>
    <h2>学生信息详情</h2>
    <div th:if="${student}" th:object="${student}">
        <p th:text="*{chineseName}">中文名字</p>
        <p th:text="*{EnglishName}">英文名字</p>
        <p th:text="*{studentId}">学号</p>
        <p th:text="*{classBatch}">班级</p>
        <p th:text="*{email}">邮箱</p>
        <p th:text="*{phoneNum}">电话号码</p>
        <p th:text="*{gender}">性别</p>
    </div>


</div>



</body>
</html>